package com.wonders.frame.entity;


import com.wonders.frame.core.entity.EntityTemplate;

import javax.persistence.*;
import java.util.List;

@SuppressWarnings("serial")
@Entity
@Table(name = "auth_orga")
public class AuthOrga extends EntityTemplate {

    @Column(name = "orga_name")
    private String orgaName;

    @Transient
    @ManyToOne(cascade={CascadeType.REFRESH})
    @JoinColumn(name="parent_id")
    private AuthOrga parent;

    @Column(name = "parent_id")
    private String parentId;

    @OneToMany(cascade={CascadeType.REFRESH, CascadeType.REMOVE}, fetch = FetchType.EAGER)
    @JoinColumn(name = "parent_id")
    private List<AuthOrga> orgaChildren;

    @Column(name = "removed")
    private Integer removed;

    @Column(name = "orga_code")
    private String orgaCode; //机构代码

    @Column(name = "orga_area")
    private String orgaArea;//机构地区代码(add)

    @Column(name = "simplename")
    private String simplename;//简称(add)

    @Column(name = "orga_type")
    private String orgaType;//机构类型

    @Column(name = "seq")
    private Integer seq;//机构序号

    @Column(name = "orga_serachindex")
    private String orgaSerachindex;//机构检索

    @Column(name = "memo")
    private String memo;//备注

    @Column(name = "creditid")
    private String creditid;//统一信用代码(add)

    @Column(name = "filepath")
    private String filepath;//证件附件

    @Column(name = "filepath2")
    private String filepath2;

    @Column(name = "orga_areas")
    private String orgaAreas;//详细区划代码逗号拼接

    @Column(name = "orga_property")
    private String orgaProperty;//机构属性

    @Column(name = "orga_show")
    private String orgaShow;//机构是否展示（飞防组织查询 y  n ）

    @Column(name = "orga_function")
    private String orgaFunction;//职能


    public String getFilepath2() {
        return filepath2;
    }

    public void setFilepath2(String filepath2) {
        this.filepath2 = filepath2;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOrgaName() {
        return orgaName;
    }

    public void setOrgaName(String orgaName) {
        this.orgaName = orgaName;
    }

    public Integer getRemoved() {
        return removed;
    }

    public void setRemoved(Integer removed) {
        this.removed = removed;
    }

    public AuthOrga getParent() {
        return parent;
    }

    public void setParent(AuthOrga parent) {
        this.parent = parent;
    }

    public List<AuthOrga> getOrgaChildren() {
        return orgaChildren;
    }

    public void setOrgaChildren(List<AuthOrga> orgaChildren) {
        this.orgaChildren = orgaChildren;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }


    public String getOrgaCode() {
        return orgaCode;
    }

    public void setOrgaCode(String orgaCode) {
        this.orgaCode = orgaCode;
    }

    public String getOrgaArea() {
        return orgaArea;
    }

    public void setOrgaArea(String orgaArea) {
        this.orgaArea = orgaArea;
    }

    public String getSimplename() {
        return simplename;
    }

    public void setSimplename(String simplename) {
        this.simplename = simplename;
    }

    public String getOrgaType() {
        return orgaType;
    }

    public void setOrgaType(String orgaType) {
        this.orgaType = orgaType;
    }

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public String getOrgaSerachindex() {
        return orgaSerachindex;
    }

    public void setOrgaSerachindex(String orgaSerachindex) {
        this.orgaSerachindex = orgaSerachindex;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }


    public String getCreditid() {
        return creditid;
    }

    public void setCreditid(String creditid) {
        this.creditid = creditid;
    }

    public String getFilepath() {
        return filepath;
    }

    public void setFilepath(String filepath) {
        this.filepath = filepath;
    }

    public String getOrgaAreas() {
        return orgaAreas;
    }

    public void setOrgaAreas(String orgaAreas) {
        this.orgaAreas = orgaAreas;
    }

    public String getOrgaProperty() {
        return orgaProperty;
    }

    public void setOrgaProperty(String orgaProperty) {
        this.orgaProperty = orgaProperty;
    }

    public String getOrgaShow() {
        return orgaShow;
    }

    public void setOrgaShow(String orgaShow) {
        this.orgaShow = orgaShow;
    }

    public String getOrgaFunction() {
        return orgaFunction;
    }

    public void setOrgaFunction(String orgaFunction) {
        this.orgaFunction = orgaFunction;
    }

    @Override
    public String toString() {
        return "AuthOrga{" +
                "orgaName='" + orgaName + '\'' +
                ", parent=" + parent +
                ", parentId='" + parentId + '\'' +
                ", orgaChildren=" + orgaChildren +
                ", removed=" + removed +
                ", orgaCode='" + orgaCode + '\'' +
                ", orgaArea='" + orgaArea + '\'' +
                ", simplename='" + simplename + '\'' +
                ", orgaType='" + orgaType + '\'' +
                ", seq=" + seq +
                ", orgaSerachindex='" + orgaSerachindex + '\'' +
                ", memo='" + memo + '\'' +
                ", creditid='" + creditid + '\'' +
                ", filepath='" + filepath + '\'' +
                ", filepath2='" + filepath2 + '\'' +
                ", orgaAreas='" + orgaAreas + '\'' +
                ", id='" + id + '\'' +
                ", removed=" + removed +
                '}';
    }
}
